package com.universe.titan.module.crudDemo.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.universe.titan.common.entity.crudDemo.Demo;
import com.universe.titan.common.vo.Result;
import com.universe.titan.module.crudDemo.service.DemoService;
import com.universe.titan.module.crudDemo.vo.DemoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : linmaobo
 * @create 2022/12/7
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @PostMapping("/getPageList")
    public Result<IPage<Demo>> getPage(@RequestBody DemoVo demoVo){
       return Result.returnSuccess(demoService.getPageByDemoVo(demoVo));
    }
}
